package com.ytjj.qmyx.admin.controller.script;

import com.ytjj.common.api.CommonResult;
import com.ytjj.common.utils.feishu.FeiShuUtil;
import com.ytjj.qmyx.admin.service.ProductService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/copyProduct")
@Slf4j
public class CopyProductController {

    @Autowired
    private ProductService productService;

    @GetMapping("/copyProduct")
    public CommonResult copyProduct(String platform) {
        try {
            productService.copyProduct(platform);
        } catch (Exception e) {
            log.error("copyProduct错误,{}",e);
            FeiShuUtil.sendMsg(String.format("copyProduct错误,{}", e.getMessage()));
        }
        return CommonResult.success();
    }


}
